// component/j-scroll/j-scroll.js
var app = getApp()
Component({

	properties: {
		keyCatid: {
			type: Number,
			value: 0,
			observer: function (newVal, oldVal) {
				var that = this;
				wx.request({
					url: app.globalData.host + 'index.php/api/goods/goodsInfo?admin_id=' + app.globalData.admin_id + '&type=' + newVal + '&code=3',
					success: function (e) {
						// console.log(e)
						that.setData({
							items: e.data.result.slice(0, that.data.limit)
						})
					}
				})
			}
		},

		// 显示多少数据量
		limit: {
			type: Number,
			value: 999,
		}
	},


	data: {
		items: []
	},

	methods: {
		onClick: function (e) {
			// console.log(e)
			this.triggerEvent('clickevent', e.currentTarget.dataset)
		}
	}
})
